<?php
class Designer_model extends MY_Model
{
    private $table = 'ym_designer';
    public function __construct()
    {
        parent::__construct();
    }
    public function get_designer_by_id($id)
    {
        $this->db->where("id",$id);
        $query=$this->db->get("ym_designer");
        return $query->row_array();
    }
   
    public function get_designer_list()
    {

		$sql = "SELECT * FROM ym_designer WHERE isDel=0 ORDER BY  addtime DESC";
		$query = $this->db->query($sql);
        return $query->result_array();        
    }
 

     //获取图片列表
    public function get_img_list_byid($id){
        $this->db->where("itemid",$id);
        $query = $this->db->get("ym_item_attach");
        $imageInfo = $query->row_array();
        return $imageInfo;
    }
    //根据id删除对应图片
    public function del_attach($id){
        $this->db->where("id",$id);
        $res = $this->db->delete("ym_item_attach");
        return $res;
    }
                   //插入图书图片
    public function add_item_img($data = array()){
        $res = $this->db->insert("ym_item_attach",$data);
        return $res;
    }   
}

/* End of file flybird/orders_model.php */
/* Location: ./application/models/orders_model.php */